package com.icode.dao.impl;

import com.icode.core.model.Client;
import com.icode.dao.ClientDao;
import org.hibernate.Query;
import org.springframework.stereotype.Repository;

/**
 * User: alexz
 * Date: 15-1-21
 * Time: 上午10:34
 */
@Repository("clientDao")
public class ClientDaoImpl extends EntityDaoImpl implements ClientDao {

    @Override
    public Client findClientByClientId(String clientId) {
        String hql = "from Client where clientId = :clientId";
        Query query = currentSession().createQuery(hql);
        query.setParameter("clientId", clientId);
        return (Client) query.uniqueResult();
    }
}
